package com.ticket.sass.common.ticketserver.enums

import com.ticket.sass.common.ticketserver.configure.ConfigData

enum class Platform(val value: String, val number: Short, val configData: Class<out ConfigData>) {
    CX("cx", 1, ConfigData.CX30::class.java),
    DX("dx", 2, ConfigData.Fhyz::class.java),
    FHYZ("fhyz", 3, ConfigData.Fhyz::class.java),
    FHJY("fhjy", 4, ConfigData.Fhyz::class.java),
    HLN("hln", 5, ConfigData.Fhyz::class.java),
    VISTA("vista", 6, ConfigData.Fhyz::class.java),
    M1905("m1905", 7, ConfigData.Fhyz::class.java),
    MTX("mtx", 8, ConfigData.Fhyz::class.java),
    CX30("cx30", 9, ConfigData.CX30::class.java),
    CX300("cx300", 10, ConfigData.CX300::class.java);

    companion object {
        fun valueOf(v: String) = values().find { it.value == v } ?: error("未匹配到枚举")

        fun numberOf(v: Short) = values().find { it.number == v } ?: error("未匹配到枚举")
    }
}